Introduction

Sorting and filtering menu categories allow customers to find what they are looking quickly, which enhances their user experience. In this exercise, you will practice how to filter the Little Lemon menu via categories and text queries.

Scenario

After displaying the online menu in the application, the restaurant managers forecast a substantial increase in the number of dishes being offered for the new season. To facilitate the location of desired items, they have decided to implement some basic filtering in the menu, so that customers can better distill the information by choosing certain categories or using a search bar to find a specific dish.

Instructions

Step 1: Category list component

Implement a component that displays a list of categories. Then, represent each category visually.

The requirements for this component are as follows:

Step 2: Create an SQL query for categories

Create an SQL query to filter a group of categories. The query should kick in as soon as there is a change in the categories selected. There are multiple ways to tackle the implementation. Here are some recommendations:

Step 3: Banner component

Implement the UI for the hero banner component, also referred to as the main banner. This component contains a title, a subtitle, a description of the restaurant, an image, and finally, a search bar. It should be placed between the header and the list of categories as represented below. You can use this mockup as inspiration, but your final outcome doesn’t have to exactly mirror it. Again, feel free to style based on your personal preferences.

Step 4: Create an SQL query for dishes

Create a SQL query to filter by dish name text match . Follow the below specifications:

Conclusion

In this exercise, you interacted with an SQLite database using the Expo-SQLite library, via different filtering conditions. This helps you envision multiple options, such as sorting capabilities, as well as more complex queries.